# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>

pkgname=alpine-keyring
_commit="aab68f8c9ab434a46710de8e12fb3206e2930a59"
pkgver=2.4
pkgrel=1
pkgdesc="Public keys for Alpine Linux packages"
url="https://git.alpinelinux.org/aports/tree/main/alpine-keys"
arch=('any')
license=("MIT")

_keys=(
	aarch64:alpine-devel@lists.alpinelinux.org-58199dcc.rsa.pub
	aarch64:alpine-devel@lists.alpinelinux.org-616ae350.rsa.pub
	armhf,armv7:alpine-devel@lists.alpinelinux.org-524d27bb.rsa.pub
	armv7:alpine-devel@lists.alpinelinux.org-616adfeb.rsa.pub
	armhf:alpine-devel@lists.alpinelinux.org-616a9724.rsa.pub

	x86:alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
	x86:alpine-devel@lists.alpinelinux.org-61666e3f.rsa.pub
	x86,x86_64:alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
	x86_64:alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
	x86_64:alpine-devel@lists.alpinelinux.org-6165ee59.rsa.pub

	ppc64le:alpine-devel@lists.alpinelinux.org-58cbb476.rsa.pub
	ppc64le:alpine-devel@lists.alpinelinux.org-616abc23.rsa.pub

	s390x:alpine-devel@lists.alpinelinux.org-58e4f17d.rsa.pub
	s390x:alpine-devel@lists.alpinelinux.org-616ac3bc.rsa.pub

	mips64:alpine-devel@lists.alpinelinux.org-5e69ca50.rsa.pub

	riscv64:alpine-devel@lists.alpinelinux.org-60ac2099.rsa.pub
	riscv64:alpine-devel@lists.alpinelinux.org-616db30d.rsa.pub
)

source=()
for _i in "${_keys[@]}"; do
    _k="${_i#*:}"
	source+=("${_k}::https://git.alpinelinux.org/aports/plain/main/alpine-keys/${_k}?id=${_commit}")
done

sha256sums=('73867d92083f2f8ab899a26ccda7ef63dfaa0032a938620eda605558958a8041'
            'd11f6b21c61b4274e182eb888883a8ba8acdbf820dcc7a6d82a7d9fc2fd2836d'
            '1bb2a846c0ea4ca9d0e7862f970863857fc33c32f5506098c636a62a726a847b'
            'ebe717d228555aa58133c202314a451f81e71f174781fd7ff8d8970d6cfa60da'
            '10877cce0a935e46ad88cb79e174a2491680508eccda08e92bf04fb9bf37fbc1'
            'ebf31683b56410ecc4c00acd9f6e2839e237a3b62b5ae7ef686705c7ba0396a9'
            '128d34d4aec39b0daedea8163cd8dc24dff36fd3d848630ab97eeb1d3084bbb3'
            '9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4'
            '12f899e55a7691225603d6fb3324940fc51cd7f133e7ead788663c2b7eecb00c'
            '207e4696d3c05f7cb05966aee557307151f1f00217af4143c1bcaf33b8df733f'
            '9a4cd858d9710963848e6d5f555325dc199d1c952b01cf6e64da2c15deedbd97'
            '4a095a9daca86da496a3cd9adcd95ee2197fdbeb84638656d469f05a4d740751'
            '780b3ed41786772cbc7b68136546fa3f897f28a23b30c72dde6225319c44cfff'
            '0caf5662fde45616d88cfd7021b7bda269a2fcaf311e51c48945a967a609ec0b'
            '59c01c57b446633249f67c04b115dd6787f4378f183dff2bbf65406df93f176d'
            'db0b49163f07ffba64a5ca198bcf1688610b0bd1f0d8d5afeaf78559d73f2278'
            '40a216cbd163f22e5f16a9e0929de7cde221b9cbae8e36aa368b1e128afe0a31')
b2sums=('b155ce2a9922f12939fdd2726e80b1d8a45ad331f4e367cc34201ce8e94fb1ab34bd56d39a19ba5bd38c0c7fecf16b5380d6764f2271f435e8d712e6ad321997'
        '977478ac11d402e4752ca1c4e7d1fd3284916dcb21282b008f4bbda9afb894594d64a09e62435d266268f160d4c875ac1c5f68f764ea67a91c3f141012f6664a'
        '88f4500710e7cc0a885dc4e69a07b604ca819a18c2a902ef8172ea375550819cecc95a66ef38a6c5e053039ca4c85c97b9831fdc062a542a8c195cda58fcbfdd'
        '41d2b627d36f2b37fb115490bb91e2db87fcde3a3811b3452d41c0999d8ee52e90d03b19b46bfa159a5a4a0f71453d29135b9ad22d67e44c641d7f62edf8d941'
        '5a557568dce763a94a4d4d42054f11d424b0d6154bd078d1ad6073f6c7fc4c51e94a6954dd7efd5c312b0a72ff753a7fe7ad4d482c5b6b04ee3a49d7921f27b2'
        '7cecabf5a3a313ae91fd12662d71e86d9971aea1078473f4f21ea278fa5c0e45c98146465ccfa6a95547a4043492a98112caa9e9cb1afd3525a1bf4eec60f3b9'
        'fa36af9ee40ce5249913251e2c34519d33e05d5bf3aaa6088753c4aa6164d6ef540cd52b717a03d3feeebe011d7e858d085addeb08007fd2cc565eba2d9e961f'
        '748e1084b642d3cb37e7018881d80650328a09697425dd8be5a2172671af9887339387e09f0fe5778eb100838eff09de9d179363b736d52216cfb3b9645a908f'
        '25a898205c4bf346e213e593086de6224fa02052036a8cf3afbe85a1899962f00494d4b79f88852b9720cc3261e9684e745118b2593f2f175c75f391f8433615'
        'e3388ac96b35c2d9cd9c1d23a9b393dc382ddeb616e1e566c6670955014101b153085bf183ec1ed37798cee7033d8d1026a8bea3c67e73ad25e9bf996aa8f09d'
        'ca3d1c48b9aee2a58e259fcebcf8a3fc755f8eb3fe520b08a40e3dc5f7b1d241c904b086b7317b4f9f7d6072fe32c16d6e62921baa0a06f00ed4d126623ddf73'
        'a23d0c9cbf84d5e48f2ece44a712d509ebb0646ba273fcf25376733dbf579e4cf763c15cb977b34cd17bcaa75198e9a06001696b5e1ee89c98b944f4d1b07336'
        'ed85c77c84a8b3870e4ddcb3dc93c121a6472f2bde6eb43792fd95bfc0339b0391a314fe2968751baf7ae7677eddf234ac8c26f9c567adab4390b81995f1b16c'
        '2447ec6ded34aceb6ee40000b900c27dc07dbcd99a45c1b06fc882abf8fb2b8373b4f2fa8f0550621c1874efedff4b0b026b0386b374830081235dd19b0bab50'
        '11e5e246e94b74729412fb6e01eea4fb7af52017708e5b8e7625d95de2a0673bca61039d6672f1dfbc460bf3e52a77c2ec4461e5ebe4fb5935e502b136f1e3c0'
        'ce7ec227adf80a5bf1f267095d6a92aab7f2757b087d38f47ecc43ac8727d19c5212f86502fff9ff3b263a137296ffc6d756ef799c55e5d0e0141594d1500029'
        'a111bce314a18f284a09b879be1ee683d508888419000d59e404e1f73f49629df8d3a7a08bd05fc0a999ed07780c9954c09deba11b558c52a452c1c8bfc8b629')

package() {
  for i in "${_keys[@]}"; do
		_archs="${i%:*}"
		_key="${i#*:}"
		install -Dm644 "${_key}" \
			"${pkgdir}/usr/share/apk/keys/${_key}"

    for _arch in ${_archs//,/ }; do
      mkdir -p "${pkgdir}/usr/share/apk/keys/${_arch}"
      ln -s "../${_key}" "${pkgdir}/usr/share/apk/keys/${_arch}/"
    done
  done
}

# vim: ts=2 sw=2 et:
